package com.game;

import android.graphics.Canvas;

import android.view.MotionEvent;

public class SceneManager {

	private Scene mCurrentScene;
	private GaismaThread mParentThread;
	
	public SceneManager(GaismaThread parentThread)
	{
		mParentThread = parentThread;
	}
	
	public void ChangeScene(Scene newScene)
    {
        if (mCurrentScene!=null) 
        {
        	mCurrentScene.End();
        }

        mCurrentScene = newScene;
        mCurrentScene.Start();
    }
	

	
	public void Update()
	{
		
		mCurrentScene.Update();
	}
	
	public void Draw (Canvas canvas)
	{
		mCurrentScene.Draw(canvas);
	}
	
	public GaismaThread getThread()
	{
		return mParentThread;		
	}
	
	public boolean handleTouch(MotionEvent event)
	{
		return mCurrentScene.handleTouch(event);
	}
	
	public boolean GotSavedGame()
	{
		return mParentThread.m_bSaveGameFound;
	}
}
